#include "spritedata.h"

SpriteData::SpriteData()
{
    imagepart_num = 0;
    image_parts = NULL;
    cdpart_num = 0;
    cd_parts = NULL;
    image_frame_num = 0;
    cd_frame_num = 0;
    ifs = NULL;
    cfs = NULL;
    anime_num = 0;
    animes = NULL;
}

SpriteData::~SpriteData(){
    delete[] image_parts;
    delete[] cd_parts;

    for (int i=0; i<image_frame_num; i++){
        delete[] ifs[i].indexs;
    }
    delete[] ifs;
    for (int i=0; i<cd_frame_num; i++){
        delete[] cfs[i].indexs;
    }
    delete[] cfs;

    for (int i=0; i<anime_num; i++){
        delete[] animes[i].image_frame_indexs;
        delete[] animes[i].cd_frame_indexs;
    }
    delete[] animes;
}
